<template>
  <div>
    <div @click="addFriend">加为好友</div>
  </div>
</template>

<script>
import axios from '../../helper/axios';

export default {
  props: ['user', 'hide'],
  methods: {
    addFriend() {
      axios.post('/api/friend/create', {
        friendUserID: this.user.id,
      }).then(() => {
        this.hide();
      });
    },
  },
};
</script>

<style>
</style>
